import { IFeidaoAiWeappPage } from '@dfeidao/atom-wxapp/interfaces';
import set_local from '@dfeidao/atom-wxapp/local/set';
import get_local from '@dfeidao/atom-wxapp/local/get';
import render from '@dfeidao/atom-wxapp/render/render';

export default async function a005(fd: IFeidaoAiWeappPage, e: {
	currentTarget: {
		dataset: {
			num: number,
		}
	}
}) {
	// todo
	console.log('------args-a005-----', e);
	const dataArray = get_local(fd, 'dataArray') as any[];
	const select_index = get_local(fd, 'select_index') as any;
	const num = e.currentTarget.dataset.num - 1;
	const key = 'dataArray[' + select_index + '].out_inv_qty';
	const param = {};
	param[key] = num;
	console.log(param);
	render(fd,
		param
	)
	dataArray[select_index].out_inv_qty = param[key];
	set_local(fd, 'dataArray', dataArray);
}
